package com.ck.texting.util;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.telephony.SmsManager;
import java.util.ArrayList;
public class SmsSend {
    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    public static void sendSMS(Context context, String phoneNumber, String message){
        //获取短信管理器
        SmsManager smsm = SmsManager.getDefault();
        ArrayList<String> divideContents = smsm.divideMessage(message);
        ArrayList<PendingIntent> pendingIntents = new ArrayList<>();

        //封装intent,在发送短信的回调中启动

        smsm.sendMultipartTextMessage(phoneNumber, null,
                divideContents, null, null);
    }

}
